<template>
<div class="">
  <router-link to="/debate" class="weui_btn weui_btn_warn" style="border-radius: 0">测试页面</router-link>
  <router-link to="/" class="weui_btn weui_btn_plain_default">Home</router-link>
  <router-link to="/debate" class="weui_btn weui_btn_plain_default">Debate</router-link>
  <router-link to="/qrcode" class="weui_btn weui_btn_plain_default">Qrcode</router-link>
  <router-link to="" class="weui_btn weui_btn_plain_default">{{items[0].group_id}}</router-link>
  <router-link to="" class="weui_btn weui_btn_plain_default">{{items[1].group_id}}</router-link>
  <div class="" style="text-align: center;">
    <div class="qrcode">
    <div id="qrcode"></div>
    <br>
    <div class="">此二维码带有您的推广标识!</div>
    </div>
  </div>
</div>
</template>

<script>
import data from '../data/data.json';
import simRecdata from '../data/simRecdata.json';
// import QRCode from '../plugin/qrcode';
// import Config from '../config/Config';
// import User from '../service/User';
// import Canvas from '../class/Canvas.js';
// import lesson2 from '../class/lesson3.js';

export default {
  data() {
    return {
      items: data.items,
      sentenceList: simRecdata.sentenceList,
      groupCount: []
    };
  },
  /**
   * created
   */
  created() {

  },
  /**
   * mounted
   */
  beforeMount() {
  },
  mounted() {
    // this.useqrcode();
  },
  methods: {
    useqrcode() {
      // new QRCode(window.document.getElementById('qrcode'), {
      //   text: `a`,
      //   width: 200,
      //   height: 200,
      //   colorDark: '#000000',
      //   colorLight: '#ffffff'
      //   // correctLevel : QRCode.CorrectLevel.H
      // });
    },
    getQueryString(name) {
      console.log('1111');
      var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
      var r = window.location.search.substr(1).match(reg);
      if (r != null) return unescape(r[2]);
      return null;
    }
  }
}
</script>

<style lang="scss" scoped>
.qrcode {
    text-align: center;
    margin-top: 3rem;
    div {
        color: #888;
        font-size:12px;
    }
    #qrcode {
        img {
            margin: 0 auto;
        }
    }
}
</style>
